package com.git.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.git.domain.User;
import com.git.mapper.DemoMapper;
import com.git.mapper.DemoSqlMapper;
import com.git.service.UserService;

@Service
public class UserServiceImpl implements UserService {
	@Autowired
	private DemoMapper demoMapper;
	@Autowired
	private DemoSqlMapper demoSqlMapper;
	@Override
	public void insert(User demoEntity) {
		this.demoMapper.insert(demoEntity);
		System.out.println(demoEntity.getId());
	}
	
	@Override
	public User getUserById(String id) {
		User user = this.demoMapper.selectByPrimaryKey(Integer.parseInt(id));
		return user;
	}

	@Override
	public User checkUser(User user) {
		return this.demoMapper.selectOne(user);
	}
}
